package com.sharkburner.common.component;

import com.sharkburner.common.listener.AddListener;
import com.sharkburner.common.listener.ButtonListener;
import com.vaadin.ui.Button;

/**
 * Add button
 * 
 * @author inartea
 * 
 */
public class AddButton extends Button implements CustomMenuComponent {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private AddListener listener;

	public AddButton() {
		super("Add");
		// TODO : set icon
		addListener(new Button.ClickListener() {
			public void buttonClick(ClickEvent event) {
				listener.add();
			}
		});
	}

	public void setListener(ButtonListener listener) {
		this.listener = (AddListener) listener;
	}
}
